package socket;

public class Users {
	private static String[][] accounts= {
			{"client1", "client1"},
			{"client2", "client2"},
			{"client3", "client3"}
	};
	
	public static boolean dataCheck(String login, String password){
		
		for (String[] account: accounts){
			System.out.println(account);
			if (account[0].equalsIgnoreCase(login) 
					&& account[1].equalsIgnoreCase(password)){
				return true;
			}
				
		}
		
		return false;
	}
	
	/*public static boolean dataCheck(String login, String password) throws IOException, FileNotFoundException {
	FileReader file = new FileReader("/ChatServer/src/test/accounts.txt"); //XXX write full path to file 
	Scanner in = new Scanner(file);
	boolean isCorrectData = false;
	while (!isCorrectData && in.hasNextLine()) {
		StringTokenizer strToken = new StringTokenizer(in.nextLine(), " .,;:\n\r\t");
		if (login.equals(strToken.nextToken()) 
				&& password.equals(strToken.nextToken()))
			isCorrectData = true;
	}
	in.close();
	file.close();

	return  isCorrectData;
}*/	
}
